/*
 * @(#)ErrorSqlExec.java   1.0  2021年11月24日
 * 
 * Copyright (c)	2014-2020. All Rights Reserved.	GuangZhou hhmk Technology Company LTD.
 */
package com.swift.dts.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swift.core.auth.Login;
import com.swift.core.model.ServiceRequest;
import com.swift.core.model.data.DataModel;
import com.swift.core.service.SynInterface;
import com.swift.core.validator.DataValidator;
import com.swift.core.validator.annotation.ParamNotNull;
import com.swift.dts.sink.ExecSqlSink;

/**
 * 添加说明 
 * @author zhengjiajin
 * @version 1.0 2021年11月24日
 */
@Service("errorSqlExec")
@Login
public class ErrorSqlExec implements SynInterface {

    @Autowired
    private ExecSqlSink execSqlSink;
    /** 
     * @see com.swift.core.service.SynInterface#doService(com.swift.core.model.ServiceRequest)
     */
    @Override
    @DataValidator(NotNull = { @ParamNotNull(param = "sqlId", message = "sqlId不能为空")})
    public DataModel doService(ServiceRequest req) {
        Long sqlId = req.getData().getLong("sqlId");
        execSqlSink.execErrorSql(sqlId);
        return null;
    }

}
